package com.liuzhengting.security.service.impl;

import com.liuzhengting.common.model.GeneralResult;
import com.liuzhengting.security.dao.SysUserMapper;
import com.liuzhengting.security.service.SysUserService;
import com.liuzhengting.template.dao.RoundMapper;
import com.liuzhengting.utils.DETION.Base64Util;
import com.liuzhengting.utils.DETION.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;

@Service
public class SysUserServiceImpl implements SysUserService {
	
	@Autowired
	private BCryptPasswordEncoder passwordEncoder;
	
	@Autowired
	private SysUserMapper sysUserMapper;
	
	@Override
	public GeneralResult findSysUserList() {
		return null;
	}
	
	@Override
	public GeneralResult findSysUserCreate(String username, String password) {
		GeneralResult generalResult = new GeneralResult();
		try{
			String passwordEncryption = passwordEncoder.encode(password);
			sysUserMapper.createUser(username,passwordEncryption);
		}catch (Exception e){
		e.printStackTrace();
		}
		return generalResult.ok();
	}
	
	@Override
	public GeneralResult findSysUserRevamp() {
		return null;
	}
	
	@Override
	public GeneralResult findSysUserRemove() {
		return null;
	}
}
